<script>
function setFocus(){
	$('identity').focus()
}

window.addEvent('load', function(){
		
		$('question').mooEditable({
		actions: 'bold italic underline strikethrough | formatBlock justifyleft justifyright justifycenter justifyfull | insertunorderedlist insertorderedlist indent outdent insertHorizontalRule | undo redo removeformat | createlink unlink | urlimage | toggleview'
		});
		
		$('answer').mooEditable({
		actions: 'bold italic underline strikethrough | formatBlock justifyleft justifyright justifycenter justifyfull | insertunorderedlist insertorderedlist indent outdent insertHorizontalRule | undo redo removeformat | createlink unlink | urlimage | toggleview'
		});
		
	//setFocus();
        new FormCheck('help_add', {
		display : {
			errorsLocation : 1,
			showErrors : 1,
			addClassErrorToField : 1
		}
	})
});

</script>
<style type="text/css">
	#question{
		width: 600px;
		height: 130px;
		padding: 10px;
		border: 2px solid #ddd;
	}
	#answer{
		width: 600px;
		height: 150px;
		padding: 10px;
		border: 2px solid #ddd;
	}
</style>

<?php $id = $this->uri->segment(3,0)?>
<form action="<?php echo site_url(array('just4u','help_update',$id))?>" method="post" enctype="multipart/form-data" name="help_edit" id="help_edit">
<?php 
foreach ($query->result() as $row):
?>
  <table width="0%" border="0" cellspacing="2" cellpadding="3">
    <tr>
      <th align="right">Title</th>
      <td><input name="title" type="text" id="title" size="35" maxlength="100" class="validate['required']" value="<?php echo $row->title?>" /></td>
    </tr>
    <tr>
      <th align="right">From / Email</th>
      <td><input name="from" type="text" id="from" size="25" maxlength="100" class="validate['required']" value="<?php echo $row->from?>" />
        /
        <input name="email" type="text" id="email" size="35" maxlength="150" class="validate['required']" value="<?php echo $row->email?>" /></td>
    </tr>
    <tr>
      <th align="right" valign="top">Question</th>
      <td><textarea name="question" id="question" cols="45" rows="6" class="validate['required']"><?php echo $row->question?></textarea></td>
    </tr>
    <tr>
      <th align="right" valign="top">Answer</th>
      <td><textarea name="answer" id="answer" cols="45" rows="6" class="validate['required']"><?php echo $row->answer?></textarea></td>
    </tr>
    <tr>
      <th align="right" valign="top">&nbsp;</th>
      <td align="right"><input type="reset" name="button2" id="button2" value="Reset" class="uiButtonRounded" />
        <input type="submit" name="button" id="button" value="Save" class="uiButtonRounded" /></td>
    </tr>
  </table>
  <?php endforeach;?>
</form>